@turnkey/webauthn-stamper
Advanced tools
Comparing version 0.4.3 to 0.5.0
'use strict'; | ||
var index = require('./webauthn-json/index.js'); | ||
var universal = require('./universal.js'); | ||
var sha256 = require('@noble/hashes/sha256'); | ||
var sha256Uint8array = require('sha256-uint8array'); | ||
@@ -48,7 +47,4 @@ /// <reference lib="dom" /> | ||
function getChallengeFromPayload(payload) { | ||
const messageBuffer = new TextEncoder().encode(payload); | ||
const hashBuffer = sha256.sha256(messageBuffer); | ||
const hexString = universal.buffer.from(hashBuffer).toString("hex"); | ||
const hexBuffer = universal.buffer.from(hexString, "utf8"); | ||
return new Uint8Array(hexBuffer); | ||
const hexString = sha256Uint8array.createHash().update(payload).digest("hex"); | ||
return new TextEncoder().encode(hexString); | ||
} | ||
@@ -55,0 +51,0 @@ |
# @turnkey/webauthn-stamper | ||
## 0.5.0 | ||
### Minor Changes | ||
- Remove dependency on `noble/hashes` and `Buffer` in favor of a minimal sha256 lib | ||
- Introduce `@turnkey/encoding` to consolidate utility functions | ||
## 0.4.3 | ||
@@ -4,0 +11,0 @@ |
'use strict'; | ||
var index = require('./webauthn-json/index.js'); | ||
var universal = require('./universal.js'); | ||
var sha256 = require('@noble/hashes/sha256'); | ||
var sha256Uint8array = require('sha256-uint8array'); | ||
@@ -48,7 +47,4 @@ /// <reference lib="dom" /> | ||
function getChallengeFromPayload(payload) { | ||
const messageBuffer = new TextEncoder().encode(payload); | ||
const hashBuffer = sha256.sha256(messageBuffer); | ||
const hexString = universal.buffer.from(hashBuffer).toString("hex"); | ||
const hexBuffer = universal.buffer.from(hexString, "utf8"); | ||
return new Uint8Array(hexBuffer); | ||
const hexString = sha256Uint8array.createHash().update(payload).digest("hex"); | ||
return new TextEncoder().encode(hexString); | ||
} | ||
@@ -55,0 +51,0 @@ |
{ | ||
"name": "@turnkey/webauthn-stamper", | ||
"version": "0.4.3", | ||
"version": "0.5.0", | ||
"main": "./dist/index.js", | ||
@@ -46,4 +46,3 @@ "module": "./dist/index.mjs", | ||
"dependencies": { | ||
"buffer": "^6.0.3", | ||
"@noble/hashes": "^1.3.2" | ||
"sha256-uint8array": "^0.10.7" | ||
}, | ||
@@ -50,0 +49,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
52517
45
563
+ Addedsha256-uint8array@^0.10.7
+ Addedsha256-uint8array@0.10.7(transitive)
- Removed@noble/hashes@^1.3.2
- Removedbuffer@^6.0.3
- Removed@noble/hashes@1.5.0(transitive)
- Removedbase64-js@1.5.1(transitive)
- Removedbuffer@6.0.3(transitive)
- Removedieee754@1.2.1(transitive)