Files
aitbc/dev/env/node_modules/ethers/lib.esm/crypto/sha2.js
aitbc 816e258d4c refactor: move brother_node development artifact to dev/test-nodes subdirectory
Development Artifact Cleanup:
 BROTHER_NODE REORGANIZATION: Moved development test node to appropriate location
- dev/test-nodes/brother_node/: Moved from root directory for better organization
- Contains development configuration, test logs, and test chain data
- No impact on production systems - purely development/testing artifact

 DEVELOPMENT ARTIFACTS IDENTIFIED:
- Chain ID: aitbc-brother-chain (test/development chain)
- Ports: 8010 (P2P) and 8011 (RPC) - different from production
- Environment: .env file with test configuration
- Logs: rpc.log and node.log from development testing session (March 15, 2026)

 ROOT DIRECTORY CLEANUP: Removed development clutter from production directory
- brother_node/ moved to dev/test-nodes/brother_node/
- Root directory now contains only production-ready components
- Development artifacts properly organized in dev/ subdirectory

DIRECTORY STRUCTURE IMPROVEMENT:
📁 dev/test-nodes/: Development and testing node configurations
🏗️ Root Directory: Clean production structure with only essential components
🧪 Development Isolation: Test environments separated from production

BENEFITS:
 Clean Production Directory: No development artifacts in root
 Better Organization: Development nodes grouped in dev/ subdirectory
 Clear Separation: Production vs development environments clearly distinguished
 Maintainability: Easier to identify and manage development components

RESULT: Successfully moved brother_node development artifact to dev/test-nodes/ subdirectory, cleaning up the root directory while preserving development testing environment for future use.
2026-03-30 17:09:06 +02:00

71 lines
1.6 KiB
JavaScript
Executable File

import { createHash } from "./crypto.js";
import { getBytes, hexlify } from "../utils/index.js";
const _sha256 = function (data) {
return createHash("sha256").update(data).digest();
};
const _sha512 = function (data) {
return createHash("sha512").update(data).digest();
};
let __sha256 = _sha256;
let __sha512 = _sha512;
let locked256 = false, locked512 = false;
/**
* Compute the cryptographic SHA2-256 hash of %%data%%.
*
* @_docloc: api/crypto:Hash Functions
* @returns DataHexstring
*
* @example:
* sha256("0x")
* //_result:
*
* sha256("0x1337")
* //_result:
*
* sha256(new Uint8Array([ 0x13, 0x37 ]))
* //_result:
*
*/
export function sha256(_data) {
const data = getBytes(_data, "data");
return hexlify(__sha256(data));
}
sha256._ = _sha256;
sha256.lock = function () { locked256 = true; };
sha256.register = function (func) {
if (locked256) {
throw new Error("sha256 is locked");
}
__sha256 = func;
};
Object.freeze(sha256);
/**
* Compute the cryptographic SHA2-512 hash of %%data%%.
*
* @_docloc: api/crypto:Hash Functions
* @returns DataHexstring
*
* @example:
* sha512("0x")
* //_result:
*
* sha512("0x1337")
* //_result:
*
* sha512(new Uint8Array([ 0x13, 0x37 ]))
* //_result:
*/
export function sha512(_data) {
const data = getBytes(_data, "data");
return hexlify(__sha512(data));
}
sha512._ = _sha512;
sha512.lock = function () { locked512 = true; };
sha512.register = function (func) {
if (locked512) {
throw new Error("sha512 is locked");
}
__sha512 = func;
};
Object.freeze(sha256);
//# sourceMappingURL=sha2.js.map