• Decrypt a String

    Type Parameters

    • Options extends {
          algorithm?: string;
          input?: "buffer" | BufferEncoding;
      }

    Parameters

    • input: Options["input"] extends "buffer"
          ? Buffer<ArrayBufferLike>
          : string
    • key: BinaryLike
    • Optional options: Options

    Returns string

    Example

    import { string } from "@rjweb/utils"

    string.decrypt('df4d0fe46e0210d4ef46368a6c3d56bb', 'secret', { algorithm: 'aes-256-cbc', input: 'hex' }) // Hello

    Since

    1.0.0

    Supports

    nodejs