You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
227 B
TypeScript
12 lines
227 B
TypeScript
7 years ago
|
export type byte = number;
|
||
|
export type base64 = string;
|
||
|
|
||
|
export function stringToByteArray(str: string): byte[] {
|
||
|
let ret = [];
|
||
|
for (let i = 0 ; i < str.length ; i++) {
|
||
|
ret.push(str.charCodeAt(i));
|
||
|
}
|
||
|
|
||
|
return ret;
|
||
|
}
|