UNPKG

@struktoai/mirage-core

Version:

A Unified Virtual Filesystem For AI Agents

28 lines • 1.4 kB
// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. ========= // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ========= Copyright 2026 @ Strukto.AI All Rights Reserved. ========= import { STDIN_OPERAND } from "../utils/constants.js"; import { stdinStream } from "../utils/stream.js"; import { hashOperands } from "./checksum.js"; function md5Line(digest, label) { return `${digest} ${label}\n`; } /** * Run BSD md5 over resolved operands. An operand's digest is asked of * `stored` first, once `stat` has found a file there, and the file is read * only when there is none. Mirrors Python's md5_generic. */ export async function md5Generic(paths, ctx, stream, stat, stored) { return hashOperands(paths.length > 0 ? paths : [STDIN_OPERAND], paths.length > 0 ? stream : stdinStream(stream, ctx.stdin), 'md5', 'md5', md5Line, stat, stored); } //# sourceMappingURL=md5.js.map