feat: 초기 프로젝트 설정 및 룰.md 파일 추가
This commit is contained in:
15
api.hyungi.net/node_modules/@simplewebauthn/server/script/helpers/toHash.js
generated
vendored
Normal file
15
api.hyungi.net/node_modules/@simplewebauthn/server/script/helpers/toHash.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.toHash = toHash;
|
||||
const index_js_1 = require("./iso/index.js");
|
||||
/**
|
||||
* Returns hash digest of the given data, using the given algorithm when provided. Defaults to using
|
||||
* SHA-256.
|
||||
*/
|
||||
function toHash(data, algorithm = -7) {
|
||||
if (typeof data === 'string') {
|
||||
data = index_js_1.isoUint8Array.fromUTF8String(data);
|
||||
}
|
||||
const digest = index_js_1.isoCrypto.digest(data, algorithm);
|
||||
return digest;
|
||||
}
|
||||
Reference in New Issue
Block a user