Class NumberToJSON

java.lang.Object
dev.sigstore.json.canonicalizer.NumberToJSON

public final class NumberToJSON extends Object
An implementation of Ryu for serializing IEEE-754 double precision values for JSON as specified by ES6
  • Constructor Details

    • NumberToJSON

      public NumberToJSON()
  • Method Details

    • serializeNumber

      public static String serializeNumber(double value) throws IOException
      Formats a number according to ES6.

      This code is emulating 7.1.12.1 of the EcmaScript V6 specification.

      Parameters:
      value - Value to be formatted
      Returns:
      String representation
      Throws:
      IOException - NaN/Infinity