@privy-io/encoding
Advanced tools
| "use strict";var e=require("@scure/base");exports.toBase64urlStringFromBytes=r=>e.base64url.encode(r); |
| "use strict";var r=require("@scure/base");exports.toBytesFromBase64urlString=e=>Uint8Array.from(r.base64url.decode(e)); |
| import{base64url as e}from"@scure/base";const o=o=>e.encode(o);export{o as toBase64urlStringFromBytes}; |
| import{base64url as r}from"@scure/base";const o=o=>Uint8Array.from(r.decode(o));export{o as toBytesFromBase64urlString}; |
@@ -1,1 +0,1 @@ | ||
| "use strict";var e=require("@scure/base");exports.toBytesFromBase64String=r=>Uint8Array.from(e.base64.decode(r)); | ||
| "use strict";var r=require("@scure/base");exports.toBytesFromBase64String=e=>{try{return Uint8Array.from(r.base64.decode(e))}catch(s){if(s instanceof Error&&s.message.includes("string should have whole number of bytes"))return Uint8Array.from(r.base64nopad.decode(e));throw s}}; |
@@ -1,1 +0,1 @@ | ||
| "use strict";var t=require("./base64/to-base64-string-from-bytes.js"),e=require("./base64/to-bytes-from-base64-string.js"),r=require("./hex/to-bytes-from-hex-string.js"),s=require("./hex/to-hex-string-from-bytes.js"),o=require("./utf8/to-bytes-from-utf8-string.js"),i=require("./utf8/to-utf8-string-from-bytes.js");require("@scure/base");const y={utf8:{fromBytes:i.toUtf8StringFromBytes,toBytes:o.toBytesFromUtf8String},base64:{fromBytes:t.toBase64StringFromBytes,toBytes:e.toBytesFromBase64String},hex:{fromBytes:s.toHexStringFromBytes,toBytes:r.toBytesFromHexString}};exports.VERSION="0.0.1",exports.encoding=y; | ||
| "use strict";var t=require("./base64/to-base64-string-from-bytes.js"),e=require("./base64/to-bytes-from-base64-string.js"),r=require("./base64url/to-base64url-string-from-bytes.js"),s=require("./base64url/to-bytes-from-base64url-string.js"),o=require("./hex/to-bytes-from-hex-string.js"),i=require("./hex/to-hex-string-from-bytes.js"),y=require("./utf8/to-bytes-from-utf8-string.js"),u=require("./utf8/to-utf8-string-from-bytes.js");require("@scure/base");const m={utf8:{fromBytes:u.toUtf8StringFromBytes,toBytes:y.toBytesFromUtf8String},base64:{fromBytes:t.toBase64StringFromBytes,toBytes:e.toBytesFromBase64String},base64url:{fromBytes:r.toBase64urlStringFromBytes,toBytes:s.toBytesFromBase64urlString},hex:{fromBytes:i.toHexStringFromBytes,toBytes:o.toBytesFromHexString}};exports.VERSION="0.1.0",exports.encoding=m; |
@@ -5,3 +5,3 @@ type NonSharedUint8Array = ReturnType<typeof Uint8Array.from>; | ||
| type Encodings = 'utf8' | 'base64' | 'hex'; | ||
| type Encodings = 'utf8' | 'base64' | 'base64url' | 'hex'; | ||
| type Encoder = { | ||
@@ -8,0 +8,0 @@ fromBytes: (u: Uint8Array) => string; |
@@ -5,3 +5,3 @@ type NonSharedUint8Array = ReturnType<typeof Uint8Array.from>; | ||
| type Encodings = 'utf8' | 'base64' | 'hex'; | ||
| type Encodings = 'utf8' | 'base64' | 'base64url' | 'hex'; | ||
| type Encoder = { | ||
@@ -8,0 +8,0 @@ fromBytes: (u: Uint8Array) => string; |
@@ -1,1 +0,1 @@ | ||
| import{base64 as r}from"@scure/base";const o=o=>Uint8Array.from(r.decode(o));export{o as toBytesFromBase64String}; | ||
| import{base64 as r,base64nopad as e}from"@scure/base";const o=o=>{try{return Uint8Array.from(r.decode(o))}catch(r){if(r instanceof Error&&r.message.includes("string should have whole number of bytes"))return Uint8Array.from(e.decode(o));throw r}};export{o as toBytesFromBase64String}; |
@@ -1,1 +0,1 @@ | ||
| import{toBase64StringFromBytes as t}from"./base64/to-base64-string-from-bytes.mjs";import{toBytesFromBase64String as o}from"./base64/to-bytes-from-base64-string.mjs";import{toBytesFromHexString as s}from"./hex/to-bytes-from-hex-string.mjs";import{toHexStringFromBytes as r}from"./hex/to-hex-string-from-bytes.mjs";import{toBytesFromUtf8String as m}from"./utf8/to-bytes-from-utf8-string.mjs";import{toUtf8StringFromBytes as e}from"./utf8/to-utf8-string-from-bytes.mjs";import"@scure/base";const f="0.0.1",i={utf8:{fromBytes:e,toBytes:m},base64:{fromBytes:t,toBytes:o},hex:{fromBytes:r,toBytes:s}};export{f as VERSION,i as encoding}; | ||
| import{toBase64StringFromBytes as t}from"./base64/to-base64-string-from-bytes.mjs";import{toBytesFromBase64String as s}from"./base64/to-bytes-from-base64-string.mjs";import{toBase64urlStringFromBytes as r}from"./base64url/to-base64url-string-from-bytes.mjs";import{toBytesFromBase64urlString as o}from"./base64url/to-bytes-from-base64url-string.mjs";import{toBytesFromHexString as m}from"./hex/to-bytes-from-hex-string.mjs";import{toHexStringFromBytes as e}from"./hex/to-hex-string-from-bytes.mjs";import{toBytesFromUtf8String as f}from"./utf8/to-bytes-from-utf8-string.mjs";import{toUtf8StringFromBytes as b}from"./utf8/to-utf8-string-from-bytes.mjs";import"@scure/base";const i="0.1.0",y={utf8:{fromBytes:b,toBytes:f},base64:{fromBytes:t,toBytes:s},base64url:{fromBytes:r,toBytes:o},hex:{fromBytes:e,toBytes:m}};export{i as VERSION,y as encoding}; |
+3
-2
| { | ||
| "name": "@privy-io/encoding", | ||
| "version": "0.0.1", | ||
| "version": "0.1.0", | ||
| "description": "Utilities for encoding and decoding strings", | ||
@@ -34,2 +34,3 @@ "license": "Apache-2.0", | ||
| "clean": "rm -rf dist .turbo .swc", | ||
| "clean:reset": "rm -rf dist .turbo .swc node_modules", | ||
| "dev:code": "rollup --config rollup.dev.mjs --watch", | ||
@@ -64,3 +65,3 @@ "dev:types": "rollup --config rollup.types.mjs --watch", | ||
| "@swc/jest": "0.2.37", | ||
| "rollup": "^4.28.0", | ||
| "rollup": "4.52.4", | ||
| "rollup-plugin-copy": "^3.5.0", | ||
@@ -67,0 +68,0 @@ "rollup-plugin-dts": "^6.1.1", |
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
17855
7.81%25
19.05%36
28.57%