Skip to content

Commit

Permalink
Remove unused randomHexString function
Browse files Browse the repository at this point in the history
  • Loading branch information
lawrence-forooghian committed Jun 13, 2023
1 parent 97a0e3b commit a8c23d6
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/common/lib/util/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,21 +479,6 @@ export const randomString = (numBytes: number): string => {
return result;
};

export const randomHexString = (numBytes: number): string => {
if (Platform.Config.getRandomValues && typeof Uint8Array !== 'undefined') {
const uIntArr = new Uint8Array(numBytes);
(Platform.Config.getRandomValues as Function)(uIntArr);
return Platform.BufferUtils.hexEncode(uIntArr);
}
const charset = Platform.BufferUtils.hexCharSet;
const length = numBytes * 2;
let result = '';
for (let i = 0; i < length; i++) {
result += charset[randomPosn(charset)];
}
return result;
};

/* Pick n elements at random without replacement from an array */
export function arrChooseN<T>(arr: Array<T>, n: number): Array<T> {
const numItems = Math.min(n, arr.length),
Expand Down

0 comments on commit a8c23d6

Please sign in to comment.