Add comprehensive installation and setup documentation

- Add GETTING_STARTED.md with quick start guide and development modes
- Add INSTALL.sh automated installation script
- Add INSTALLATION_CHECKLIST.md, INSTALLATION_SUCCESS.md, and INSTALLATION_SUMMARY.md
- Add QUICK_REFERENCE.md for common commands
- Add SETUP_GUIDE.md with detailed setup instructions
- Update README.md with improved project overview
- Add did-wallet app dependencies and node_modules
This commit is contained in:
Dorian
2026-01-27 17:18:21 +00:00
parent a81f655133
commit 0d073fa89e
22658 changed files with 4494151 additions and 6 deletions

21
apps/did-wallet/node_modules/utf8-codec/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 Martin Heidegger
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

38
apps/did-wallet/node_modules/utf8-codec/README.md generated vendored Normal file
View File

@@ -0,0 +1,38 @@
# utf8-codec
A javascript-only (esm/cjs) utf8 codec that is [abstract-encoding][] compatible,
well-tested and pretty efficient. Bonus: It doesn't use Nodejs' Buffer object
and comes with typescript types.
[abstract-encoding]: https://github.com/mafintosh/abstract-encoding
## Usage
```js
import { encode, encodingLength, decode } from 'utf8-codec' // require works too!
const str = 'Hello World / こんにちは世界'
const bytes = encode(
str,
new Uint8Array(endcodingLength(str)), // own buffer supplied, optional
0 // offset, at which to write the str, optional
)
str === decode(bytes, 0, bytes.length)
```
## Why?
The [TextEncoder][] and [TextDecoder][] classes _exist_ to encode utf8 strings but
they are not optimized for bigger byte processing and don't offer APIs to figure
out how preemptively how many bytes are supposed to be written/read. Surprisingly
this algorithm is even faster.
The other implementations found at the time do either not implement the edge cases
properly and/or both directions of the codec.
[TextEncoder]: https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder
[TextDecoder]: https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder
## License
[MIT](./LICENSE)

149
apps/did-wallet/node_modules/utf8-codec/index.js generated vendored Normal file
View File

@@ -0,0 +1,149 @@
// GENERATED FILE. DO NOT EDIT.
var utf8Codec = (function(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.decode = decode;
exports.encode = encode;
exports.encodingLength = encodingLength;
exports.name = void 0;
const SURROGATE_A = 0b1101100000000000;
const SURROGATE_B = 0b1101110000000000;
const name = 'utf8';
exports.name = name;
function encodingLength(str) {
let len = 0;
const strLen = str.length;
for (let i = 0; i < strLen; i += 1) {
const code = str.charCodeAt(i);
if (code <= 0x7F) {
len += 1;
} else if (code <= 0x07FF) {
len += 2;
} else if ((code & 0xF800) !== SURROGATE_A) {
len += 3;
} else {
const next = i + 1;
if (next === strLen || code >= SURROGATE_B) {
len += 3;
} else {
const nextCode = str.charCodeAt(next);
if ((nextCode & 0xFC00) !== SURROGATE_B) {
len += 3;
} else {
i = next;
len += 4;
}
}
}
}
return len;
}
function encode(str, buf, offset) {
const strLen = str.length;
if (offset === undefined || offset === null) {
offset = 0;
}
if (buf === undefined) {
buf = new Uint8Array(encodingLength(str) + offset);
}
let off = offset;
for (let i = 0; i < strLen; i += 1) {
let code = str.charCodeAt(i);
if (code <= 0x7F) {
buf[off++] = code;
} else if (code <= 0x07FF) {
buf[off++] = 0b11000000 | (code & 0b11111000000) >> 6;
buf[off++] = 0b10000000 | code & 0b00000111111;
} else if ((code & 0xF800) !== SURROGATE_A) {
buf[off++] = 0b11100000 | (code & 0b1111000000000000) >> 12;
buf[off++] = 0b10000000 | (code & 0b0000111111000000) >> 6;
buf[off++] = 0b10000000 | code & 0b0000000000111111;
} else {
const next = i + 1;
if (next === strLen || code >= SURROGATE_B) {
// Incorrectly started surrogate pair
buf[off++] = 0xef;
buf[off++] = 0xbf;
buf[off++] = 0xbd;
} else {
const nextCode = str.charCodeAt(next);
if ((nextCode & 0xFC00) !== SURROGATE_B) {
// Incorrect surrogate pair
buf[off++] = 0xef;
buf[off++] = 0xbf;
buf[off++] = 0xbd;
} else {
i = next;
code = 0b000010000000000000000 | (code & 0b1111111111) << 10 | nextCode & 0b1111111111;
buf[off++] = 0b11110000 | (code & 0b111000000000000000000) >> 18;
buf[off++] = 0b10000000 | (code & 0b000111111000000000000) >> 12;
buf[off++] = 0b10000000 | (code & 0b000000000111111000000) >> 6;
buf[off++] = 0b10000000 | code & 0b000000000000000111111;
}
}
}
}
encode.bytes = off - offset;
return buf;
}
encode.bytes = 0;
function decode(buf, start, end) {
let result = '';
if (start === undefined || start === null) {
start = 0;
}
if (end === undefined || end === null) {
end = buf.length;
}
for (let offset = start; offset < end;) {
const code = buf[offset++];
let num;
if (code <= 128) {
num = code;
} else if (code > 191 && code < 224) {
num = (code & 0b11111) << 6 | buf[offset++] & 0b111111;
} else if (code > 239 && code < 365) {
num = ((code & 0b111) << 18 | (buf[offset++] & 0b111111) << 12 | (buf[offset++] & 0b111111) << 6 | buf[offset++] & 0b111111) - 0x10000;
const numA = SURROGATE_A | num >> 10 & 0b1111111111;
result += String.fromCharCode(numA);
num = SURROGATE_B | num & 0b1111111111;
} else {
num = (code & 0b1111) << 12 | (buf[offset++] & 0b111111) << 6 | buf[offset++] & 0b111111;
}
result += String.fromCharCode(num);
}
decode.bytes = end - start;
return result;
}
decode.bytes = 0;
return "default" in exports ? exports.default : exports;
})({});
if (typeof define === 'function' && define.amd) define([], function() { return utf8Codec; });
else if (typeof module === 'object' && typeof exports==='object') module.exports = utf8Codec;

122
apps/did-wallet/node_modules/utf8-codec/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,122 @@
const SURROGATE_A = 0b1101100000000000
const SURROGATE_B = 0b1101110000000000
export const name = 'utf8'
export function encodingLength (str) {
let len = 0
const strLen = str.length
for (let i = 0; i < strLen; i += 1) {
const code = str.charCodeAt(i)
if (code <= 0x7F) {
len += 1
} else if (code <= 0x07FF) {
len += 2
} else if ((code & 0xF800) !== SURROGATE_A) {
len += 3
} else {
const next = i + 1
if (next === strLen || code >= SURROGATE_B) {
len += 3
} else {
const nextCode = str.charCodeAt(next)
if ((nextCode & 0xFC00) !== SURROGATE_B) {
len += 3
} else {
i = next
len += 4
}
}
}
}
return len
}
export function encode (str, buf, offset) {
const strLen = str.length
if (offset === undefined || offset === null) {
offset = 0
}
if (buf === undefined) {
buf = new Uint8Array(encodingLength(str) + offset)
}
let off = offset
for (let i = 0; i < strLen; i += 1) {
let code = str.charCodeAt(i)
if (code <= 0x7F) {
buf[off++] = code
} else if (code <= 0x07FF) {
buf[off++] = 0b11000000 | ((code & 0b11111000000) >> 6)
buf[off++] = 0b10000000 | (code & 0b00000111111)
} else if ((code & 0xF800) !== SURROGATE_A) {
buf[off++] = 0b11100000 | ((code & 0b1111000000000000) >> 12)
buf[off++] = 0b10000000 | ((code & 0b0000111111000000) >> 6)
buf[off++] = 0b10000000 | (code & 0b0000000000111111)
} else {
const next = i + 1
if (next === strLen || code >= SURROGATE_B) {
// Incorrectly started surrogate pair
buf[off++] = 0xef
buf[off++] = 0xbf
buf[off++] = 0xbd
} else {
const nextCode = str.charCodeAt(next)
if ((nextCode & 0xFC00) !== SURROGATE_B) {
// Incorrect surrogate pair
buf[off++] = 0xef
buf[off++] = 0xbf
buf[off++] = 0xbd
} else {
i = next
code = 0b000010000000000000000 |
((code & 0b1111111111) << 10) |
(nextCode & 0b1111111111)
buf[off++] = 0b11110000 | ((code & 0b111000000000000000000) >> 18)
buf[off++] = 0b10000000 | ((code & 0b000111111000000000000) >> 12)
buf[off++] = 0b10000000 | ((code & 0b000000000111111000000) >> 6)
buf[off++] = 0b10000000 | (code & 0b000000000000000111111)
}
}
}
}
encode.bytes = off - offset
return buf
}
encode.bytes = 0
export function decode (buf, start, end) {
let result = ''
if (start === undefined || start === null) {
start = 0
}
if (end === undefined || end === null) {
end = buf.length
}
for (let offset = start; offset < end;) {
const code = buf[offset++]
let num
if (code <= 128) {
num = code
} else if (code > 191 && code < 224) {
num = ((code & 0b11111) << 6) | (buf[offset++] & 0b111111)
} else if (code > 239 && code < 365) {
num = (
((code & 0b111) << 18) |
((buf[offset++] & 0b111111) << 12) |
((buf[offset++] & 0b111111) << 6) |
(buf[offset++] & 0b111111)
) - 0x10000
const numA = SURROGATE_A | ((num >> 10) & 0b1111111111)
result += String.fromCharCode(numA)
num = SURROGATE_B | (num & 0b1111111111)
} else {
num = ((code & 0b1111) << 12) |
((buf[offset++] & 0b111111) << 6) |
(buf[offset++] & 0b111111)
}
result += String.fromCharCode(num)
}
decode.bytes = end - start
return result
}
decode.bytes = 0

46
apps/did-wallet/node_modules/utf8-codec/package.json generated vendored Normal file
View File

@@ -0,0 +1,46 @@
{
"name": "utf8-codec",
"version": "1.0.0",
"description": "utf8 to/from bytes codec (esm/cjs)",
"main": "index.js",
"module": "index.mjs",
"types": "./types/index.d.ts",
"exports": {
"require": "./index.js",
"import": "./index.mjs",
"types": "./types/index.d.ts"
},
"scripts": {
"test": "npm run lint && npm run unit",
"lint": "standard && dtslint types --localTs node_modules/typescript/lib",
"unit": "node test.mjs",
"coverage": "c8 -r html -r text npm run unit",
"prepare": "esm2umd utf8Codec"
},
"keywords": [
"utf8",
"codec",
"bytes",
"encoding",
"buffer",
"uint8array"
],
"author": "Martin Heidegger <martin.heidegger@gmail.com>",
"license": "MIT",
"devDependencies": {
"@definitelytyped/dtslint": "^0.0.112",
"@leichtgewicht/esm2umd": "^0.3.4",
"c8": "^7.11.3",
"fresh-tape": "^5.5.3",
"standard": "^17.0.0",
"typescript": "^4.7.2"
},
"repository": {
"type": "git",
"url": "git+https://github.com/martinheidegger/utf8-codec.git"
},
"bugs": {
"url": "https://github.com/martinheidegger/utf8-codec/issues"
},
"homepage": "https://github.com/martinheidegger/utf8-codec#readme"
}

115
apps/did-wallet/node_modules/utf8-codec/test.mjs generated vendored Normal file
View File

@@ -0,0 +1,115 @@
import test from 'fresh-tape'
import { encodingLength, encode, decode } from './index.mjs'
import * as utf8Codec from './index.mjs'
import { Buffer } from 'buffer'
function toHex (uint8) {
return Buffer.from(uint8).toString('hex')
}
const TEST_STRINGS = [
'', // empty
'basic: hi',
'japanese: 日本語',
'mixed: 日本語 hi',
'min 1 byte: \x00',
'odd 1 byte: \x4c',
'max 1 byte: \x7f',
'min 2 byte: \x80',
'odd 2 byte: \xd941',
'max 2 byte: \x7fff',
'min 3 byte: \x8000',
'odd 3 byte: \xa158',
'max 3 byte: \xffff',
`4 byte: ${String.fromCodePoint(100000)}`
]
TEST_STRINGS.forEach((fixture, index) => {
test(`fixture #${index}`, t => {
const check = Buffer.from(fixture)
const len = check.length
t.equals(encodingLength(fixture), len, `fixture ${fixture} length`)
const buf = new Uint8Array(len)
t.equals(toHex(encode(fixture, buf, 0), 0, len), check.toString('hex'), `write: ${fixture}`)
t.equals(encode.bytes, len, 'write.num')
t.equals(decode(check), check.toString(), `toUtf8: ${fixture}`)
t.equals(decode.bytes, check.length, 'write.num')
t.end()
})
})
test('surrogate pairs', function (t) {
[
[0xd821, 0xdea0],
[0xd800, 0xdc00],
[0xd801, 0xdc01],
[0xddff, 0xdfff],
[0xd821, 0x0000],
[0xd821, 0xd821, 0xdea0]
].forEach(function (bytes, index) {
const str = String.fromCharCode(...bytes)
const check = Buffer.from(str)
const buf = encode(str)
t.equal(buf.length, check.length)
t.equal(toHex(buf, 0, buf.length), check.toString('hex'), `#${index} [${bytes}].toHex() ... ${check.toString('hex')}`)
t.equal(decode(buf, 0, buf.length), check.toString(), `#${index} [${bytes}].toUtf8`)
})
t.end()
})
test('all code points', function (t) {
const blockSize = 2048
const blocks = 65536 / blockSize
let code = 0
for (let block = 0; block < blocks; block += 1) {
const expected = {}
const actual = {}
for (let i = 0; i < blockSize; i += 1, code += 1) {
const str = String.fromCharCode(code)
const buf = new Uint8Array(encodingLength(str))
encode(str, buf, 0)
const exp = Buffer.from(str)
expected[code] = exp.toString('hex')
actual[code] = toHex(buf, 0, buf.length)
}
t.same(actual, expected)
}
t.end()
})
test('performance', { skip: typeof TextDecoder === 'undefined' }, function (t) {
function run (impl) {
const start = Date.now()
for (let i = 0; i < 10000; i++) {
TEST_STRINGS.forEach(function (str) {
impl.encodingLength(str)
impl.decode(impl.encode(str))
})
}
return Date.now() - start
}
const encoder = new TextEncoder()
const decoder = new TextDecoder()
const native = {
encode (str, buf, offset) {
return encoder.encode(str)
},
decode (str) {
return decoder.decode(str)
},
encodingLength (str) {
return encoder.encode(str).length
}
}
TEST_STRINGS.forEach(function (str) {
const bytes = native.encode(str)
t.same(bytes, utf8Codec.encode(str))
t.same(native.decode(bytes), utf8Codec.decode(bytes))
t.same(native.encodingLength(str), utf8Codec.encodingLength(str))
})
const perf = {
native: run(native),
utf8: run(utf8Codec)
}
t.ok(perf.native > perf.utf8, `native(${perf.native}ms) > utf8-codec(${perf.utf8}ms)`)
t.end()
})

View File

@@ -0,0 +1,9 @@
export function encodingLength(input: string | Uint8Array): number;
type WithBytes<T> = T & {
bytes: number
};
export const encode: WithBytes<<T extends Uint8Array = Uint8Array> (str: string, arr?: T, start?: number) => T>;
export const decode: WithBytes<(buf: Uint8Array, start?: number, end?: number) => string>;
export const name: 'utf8';
export {};