mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
chore(uuid): cleanup unused internal functions (#2797)
This commit is contained in:
parent
ac27913868
commit
db40030a4f
@ -37,29 +37,3 @@ export function uuidToBytes(uuid: string): number[] {
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a string to a byte array using the char code.
|
||||
* @param str Value that gets converted.
|
||||
*/
|
||||
export function stringToBytes(str: string): number[] {
|
||||
str = unescape(encodeURIComponent(str));
|
||||
const bytes = Array.from<number>({ length: str.length });
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
bytes[i] = str.charCodeAt(i);
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a buffer for creating a SHA-1 hash.
|
||||
* @param content Buffer for SHA-1 hash.
|
||||
*/
|
||||
export function createBuffer(content: number[]): ArrayBuffer {
|
||||
const arrayBuffer = new ArrayBuffer(content.length);
|
||||
const uint8Array = new Uint8Array(arrayBuffer);
|
||||
for (let i = 0; i < content.length; i++) {
|
||||
uint8Array[i] = content[i];
|
||||
}
|
||||
return arrayBuffer;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user