Skip to content

Commit

Permalink
the bestest feedback ever
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewkmin committed Jul 24, 2024
1 parent bfae48a commit c039e13
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion auth/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ <h2>Message log</h2>
/**
* Converts a `BigInt` into a base64url encoded string
* @param {BigInt} num
* @param {number} length: optional expected length of the resulting buffer
* @param {number} length: optional number of bytes contained in the resulting string
* @return {string}
*/
var bigIntToBase64Url = function(num, length) {
Expand Down
4 changes: 4 additions & 0 deletions auth/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ describe("TKHQ", () => {
expect(() => {
TKHQ.uint8arrayFromHexString("oops");
}).toThrow('cannot create uint8array from invalid hex string: "oops"');
// Happy path: if length parameter is included, pad the resulting buffer
expect(TKHQ.uint8arrayFromHexString("01", 2).toString()).toEqual("0,1");
// Happy path: if length parameter is omitted, do not pad the resulting buffer
expect(TKHQ.uint8arrayFromHexString("01").toString()).toEqual("1");
})

it("contains bigIntToHex", () => {
Expand Down

0 comments on commit c039e13

Please sign in to comment.