Compare commits

...

3 Commits

Author SHA1 Message Date
semantic-release-bot 1c7aaf84d4 chore(release): 0.1.0-develop.77 [skip ci]
# [0.1.0-develop.77](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.76...v0.1.0-develop.77) (2023-11-18)

### Bug Fixes

* replace u with U in decodeString, and strip U in toBase64Url ([01d29f0](01d29f0b59))
2023-11-18 13:21:16 +00:00
Derrick Hammer ea8c9841a0
Merge remote-tracking branch 'origin/develop' into develop 2023-11-18 08:20:16 -05:00
Derrick Hammer 01d29f0b59
fix: replace u with U in decodeString, and strip U in toBase64Url 2023-11-18 08:20:13 -05:00
4 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,10 @@
# [0.1.0-develop.77](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.76...v0.1.0-develop.77) (2023-11-18)
### Bug Fixes
* replace u with U in decodeString, and strip U in toBase64Url ([01d29f0](https://git.lumeweb.com/LumeWeb/libs5/commit/01d29f0b59cdadfb23c826d9649ed635745fa45e))
# [0.1.0-develop.76](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.75...v0.1.0-develop.76) (2023-11-18) # [0.1.0-develop.76](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.75...v0.1.0-develop.76) (2023-11-18)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@lumeweb/libs5", "name": "@lumeweb/libs5",
"version": "0.1.0-develop.76", "version": "0.1.0-develop.77",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lumeweb/libs5", "name": "@lumeweb/libs5",
"version": "0.1.0-develop.76", "version": "0.1.0-develop.77",
"dependencies": { "dependencies": {
"@noble/curves": "^1.1.0", "@noble/curves": "^1.1.0",
"@noble/hashes": "^1.3.1", "@noble/hashes": "^1.3.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "@lumeweb/libs5", "name": "@lumeweb/libs5",
"version": "0.1.0-develop.76", "version": "0.1.0-develop.77",
"type": "module", "type": "module",
"main": "lib/index.js", "main": "lib/index.js",
"repository": { "repository": {

View File

@ -19,7 +19,7 @@ export default abstract class Multibase {
} }
bytes = base32.decode(str); bytes = base32.decode(str);
} else if (data[0] === "u") { } else if (data[0] === "u") {
bytes = base64urlpad.decode(data); bytes = base64urlpad.decode(data[0].toUpperCase() + data.substring(1));
} else if (data[0] === ":") { } else if (data[0] === ":") {
bytes = utf8ToBytes(data); bytes = utf8ToBytes(data);
} else { } else {
@ -38,7 +38,7 @@ export default abstract class Multibase {
} }
toBase64Url(): string { toBase64Url(): string {
return `u${base64urlpad.encode(this.toBytes())}`; return `u${base64urlpad.encode(this.toBytes()).substring(1)}`;
} }
toBase58(): string { toBase58(): string {