BC-LifeHash-CLI TypeScript Library - v1.0.0-alpha.20
    Preparing search index...

    Function generateLifeHash

    • Generates a LifeHash PNG buffer from an input string.

      This is the main programmatic API for generating LifeHash images.

      Parameters

      • input: string

        The input string to hash

      • options: GenerateOptions = {}

        Generation options

      Returns Buffer

      A Buffer containing the PNG data

      import { generateLifeHash } from "@bcts/lifehash-cli";
      import { writeFileSync } from "fs";

      const pngBuffer = generateLifeHash("Hello", {
      version: "version2",
      moduleSize: 1,
      });

      writeFileSync("Hello.png", pngBuffer);