diff --git a/src/libs/actions/Policy.js b/src/libs/actions/Policy.js index 46a2c398ec8f..b7e4f3a09e97 100644 --- a/src/libs/actions/Policy.js +++ b/src/libs/actions/Policy.js @@ -637,6 +637,14 @@ function hasPolicyMemberError(policyMemberList) { return _.some(policyMemberList, member => !_.isEmpty(member.errors)); } +/** + * Returns a client generated 16 character hexadecimal value for the policyID + * @returns {String} + */ +function generatePolicyID() { + return _.times(16, () => Math.floor(Math.random() * 16).toString(16)).join('').toUpperCase(); +} + export { getPolicyList, loadFullPolicy, @@ -660,4 +668,5 @@ export { hasPolicyMemberError, deleteWorkspaceAvatar, clearAvatarErrors, + generatePolicyID, };