TeaWeb/js/utils/helpers.ts

11 lines
363 B
TypeScript
Raw Normal View History

2018-04-16 20:38:35 +02:00
/// <reference path="../crypto/sha.ts" />
namespace helpers {
export function hashPassword(password: string) : Promise<string> {
return new Promise<string>((resolve, reject) => {
sha.sha1(password).then(result => {
resolve(btoa(String.fromCharCode.apply(null, new Uint8Array(result))));
});
});
}
}