guiddigitencoder
Reactive icon

GuidDigitEncoder

Stable version 1.0.1 (Compatible with OutSystems 11)
Uploaded
 on 5 May (19 hours ago)
 by 
4.0
 (1 rating)
guiddigitencoder

GuidDigitEncoder

Documentation
1.0.1

📘 GUID Digit Encoder – Full Documentation


🧩 Overview

Encodes and decodes numeric values using a fixed mapping between digits (0–9) and predefined GUIDs, allowing for reversible obfuscation of numeric data.


📚 Purpose

  • Obscure internal numeric IDs in a non-predictable format.

  • Provide reversible representations of numbers.

  • Serve as an educational tool for encoding/decoding methods.


🔠 GUID Mapping

  • 10 predefined GUIDs, each mapped to digits 0–9.

  • These GUIDs remain fixed for consistent encoding/decoding.


🔤 Delimiter

  • EN DASH (–) is used to separate individual GUIDs in the encoded string.


🔧 Methods

MssEncodeNumberToGuids

  • Description: Encodes a non-negative integer into a GUID sequence.

  • Parameters:

    • ssnumericValue (long) – The number to encode.

    • ssguidSequence (out string) – The resulting encoded GUID string.

  • Notes:

    • Returns empty string for negative/invalid inputs.

    • Only digits [0–9] are valid inputs.

MssDecodeGuidsToNumber

  • Description: Decodes a GUID sequence back into the original number.

  • Parameters:

    • ssguidSequence (string) – The encoded string.

    • ssnumericValue (out long) – The decoded number.

  • Notes:

    • Returns -1 if input is malformed or contains invalid GUIDs.


🧪 Use Cases

  • Safely represent numeric IDs in URLs/logs.

  • Create tamper-resistant codes.

  • Integrate with OutSystems or .NET for utility purposes.


🏁 Performance Notes

  • Uses StringBuilder for efficient string operations.

  • Uses Array.FindIndex for digit-to-GUID lookups – optimal for small arrays.


🏷 Tags

GUID, Encoding, Decoding, Numeric Obfuscation, Reversible Mapping, OutSystems, Security, Data Masking, Utilities


🔁 Versions

  • Version 1 (Default):
    Standard encoding behavior—each digit is mapped directly to a corresponding GUID. Leading zeros are not preserved in the decoded result.

  • Version 2 (Support for Leading Zeros like "00"):
    Special handling when input starts with "00" or other significant leading zeros. This version retains or encodes the structure to allow accurate reconstruction of such values after decoding.


1.0.0

📘 GUID Digit Encoder – Full Documentation

🧩 Overview

The GUID Digit Encoder is a utility that encodes numeric values into a sequence of GUIDs and decodes them back to their original form. It uses a fixed mapping between digits (0–9) and predefined GUIDs, enabling reversible obfuscation of numeric data.


📚 Purpose

This component is designed for:

  • Obscuring numeric IDs in a non-sequential, non-predictable format.

  • Creating reversible representations of numbers.

  • Demonstrating basic encoding and decoding principles for educational or utility purposes.


🔠 GUID Mapping

A fixed array of 10 GUIDs is used, where each GUID corresponds to a digit from 0 to 9.


🔤 Delimiter

A special character (, EN DASH) is used to separate GUIDs in the encoded string.


🔧 Methods

MssEncodeNumberToGuids

🔍 Description:

Encodes a non-negative integer by converting each digit to its mapped GUID.

📥 Parameters:

  • ssnumericValue (long): The input number to encode.

  • ssguidSequence (out string): The resulting GUID sequence string.

⚠ Notes:

  • Returns an empty string if the input is negative or invalid.

  • Only digits between 0 and 9 are valid.


MssDecodeGuidsToNumber

🔍 Description:

Decodes a GUID sequence string back into the original numeric value.

📥 Parameters:

  • ssguidSequence (string): The encoded GUID string.

  • ssnumericValue (out long): The decoded numeric value.

⚠ Notes:

  • Returns -1 if any GUID is invalid or if the input string is empty or malformed.


🧪 Use Cases

  • Securely representing internal numeric identifiers in URLs or logs.

  • Creating human-unfriendly codes to discourage tampering or guessing.

  • Utility component in OutSystems or .NET-based applications.


🏁 Performance Notes

  • Uses efficient StringBuilder for string manipulation.

  • Uses Array.FindIndex for matching, which is performant for the small fixed array.


🏷 Tags

GUID, Encoding, Decoding, Numeric Obfuscation, Reversible Mapping, OutSystems, Security, Data Masking, Utilities