Class JdkSha256HexIdGenerator

java.lang.Object
org.springframework.ai.document.id.JdkSha256HexIdGenerator
All Implemented Interfaces:
IdGenerator

public class JdkSha256HexIdGenerator extends Object implements IdGenerator
A SHA-256 based ID generator that returns the hash as a UUID.
Author:
Aliakbar Jafarpour, Christian Tzolov
  • Constructor Details

    • JdkSha256HexIdGenerator

      public JdkSha256HexIdGenerator(String algorithm, Charset charset)
    • JdkSha256HexIdGenerator

      public JdkSha256HexIdGenerator()
  • Method Details

    • generateId

      public String generateId(Object... contents)
      Description copied from interface: IdGenerator
      Generate a unique ID for the given content. Note: some generator, such as the the random generator might not dependant on or use the content parameters.
      Specified by:
      generateId in interface IdGenerator
      Parameters:
      contents - the content to generate an ID for.
      Returns:
      the generated ID.