>>358 js
const input = "programmingodaisure"
let tmp_str = input;
let tmp_hex = new Uint8Array();
do {
tmp_str += "X";
tmp_hex = [0x00, ...Base58.decode(tmp_str)];
} while (tmp_hex.length < 25)
const prefix_and_data = tmp_hex.slice(0, -4);
const doubleSha256 = sha256.digest(sha256.digest(prefix_and_data))
const checkSum = doubleSha256.slice(0, 4);
const result_hex = new Uint8Array([...prefix_and_data, ...checkSum]);
const result_str = Base58.encode(result_hex);
console.log(result_str);
→ "1programmingodaisureXXXXXXXZHx9sj"
https://chainflyer.bitflyer.jp/Address/1programmingodaisureXXXXXXXZHx9sj BASE58とSHA256のライブラリ
https://cdn.jsdelivr.net/npm/base-58@0.0.1/Base58.min.js https://cdn.jsdelivr.net/npm/js-sha256@0.9.0/src/sha256.min.js