Unverified Commit e74c2df2 authored by Hong Minhee's avatar Hong Minhee
Browse files

Remove dependency on @std/bytes

parent 66f5c864
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@
    "@opentelemetry/semantic-conventions": "npm:@opentelemetry/semantic-conventions@^1.27.0",
    "@phensley/language-tag": "npm:@phensley/language-tag@^1.9.0",
    "@std/assert": "jsr:@std/assert@^0.226.0",
    "@std/bytes": "jsr:@std/bytes@^1.0.2",
    "@std/crypto": "jsr:@std/crypto@^1.0.4",
    "@std/encoding": "jsr:@std/encoding@1.0.7",
    "@std/http": "jsr:@std/http@^1.0.6",
+3 −2
Original line number Diff line number Diff line
import { concat } from "@std/bytes/concat";
import { decodeBase64, encodeBase64 } from "@std/encoding/base64";
import { decodeBase64Url } from "@std/encoding/base64url";
import { decodeHex } from "@std/encoding/hex";
@@ -153,7 +152,9 @@ export async function exportMultibaseKey(key: CryptoKey): Promise<string> {
      "SHA-256"
  ) {
    const jwk = await crypto.subtle.exportKey("jwk", key);
    const n = concat([new Uint8Array([0]), decodeBase64Url(jwk.n!)]);
    const decodedN = decodeBase64Url(jwk.n!);
    const n = new Uint8Array(decodedN.length + 1);
    n.set(decodedN, 1);
    const sequence = new Sequence({
      value: [
        new Integer({