-
Notifications
You must be signed in to change notification settings - Fork 265
[Smart Hashing] Add smart hashing documentation in readme #2860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
README.md
Outdated
### Key Benefits | ||
|
||
- **Automatic Hashing Detection**: Avoids double-hashing by identifying already hashed values. | ||
- **Consistent Hashing**: Applies the correct algorithm and format across use cases. | ||
- **Optional Input Normalization**: Supports custom logic for cleaning and standardizing inputs (e.g., trimming, formatting). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section is not needed.
### Key Benefits | |
- **Automatic Hashing Detection**: Avoids double-hashing by identifying already hashed values. | |
- **Consistent Hashing**: Applies the correct algorithm and format across use cases. | |
- **Optional Input Normalization**: Supports custom logic for cleaning and standardizing inputs (e.g., trimming, formatting). |
README.md
Outdated
Use the `processHashing` utility to hash Personally Identifiable Information (PII)—like email addresses and phone numbers. | ||
|
||
This utility simplifies workflows by automatically detecting and handling pre-hashed values, ensuring compatibility across destinations and preventing common data-matching issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the `processHashing` utility to hash Personally Identifiable Information (PII)—like email addresses and phone numbers. | |
This utility simplifies workflows by automatically detecting and handling pre-hashed values, ensuring compatibility across destinations and preventing common data-matching issues. | |
Our popular segment Adtect destinations support [automatic hash detection](https://segment.com/docs/connections/destinations/#hashing) of personally identifyable information (PII). If your destination hashes PII data, we recommend you use the `processHashing` utility instead of `createHash` from `crypto` module. | |
The `processHashing` utility supports `md5`, `sha1`,`sha224`,`sha256`,`sha384` and`sha512` hashing algorithms. It can output digests in `hex` or `base64` format. | |
**Note**: For empty or whitespace-only strings, the `processHashing` outputs an empty string instead of throwing an error like `createHash` hash module. |
|
||
``` | ||
|
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
``` | |
``` |
README.md
Outdated
### Notes | ||
|
||
**Empty Input Handling**: Returns `''` for empty or whitespace-only strings. | ||
|
||
**Supported Hash Algorithms** | ||
|
||
- `md5` | ||
- `sha1` | ||
- `sha224` | ||
- `sha256` | ||
- `sha384` | ||
- `sha512` | ||
|
||
All algorithms support `hex` and `base64` digest formats. | ||
|
||
**Requesting Additional Algorithms** | ||
To request additional hash algorithms, contact [email protected]. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Notes | |
**Empty Input Handling**: Returns `''` for empty or whitespace-only strings. | |
**Supported Hash Algorithms** | |
- `md5` | |
- `sha1` | |
- `sha224` | |
- `sha256` | |
- `sha384` | |
- `sha512` | |
All algorithms support `hex` and `base64` digest formats. | |
**Requesting Additional Algorithms** | |
To request additional hash algorithms, contact [email protected]. | |
### Notes | |
**Empty Input Handling**: Returns `''` for empty or whitespace-only strings. | |
**Supported Hash Algorithms** | |
- `md5` | |
- `sha1` | |
- `sha224` | |
- `sha256` | |
- `sha384` | |
- `sha512` | |
All algorithms support `hex` and `base64` digest formats. | |
**Requesting Additional Algorithms** | |
To request additional hash algorithms, contact [email protected]. | |
@@ -960,6 +960,49 @@ There are a few subtle differences from the Fetch API which are meant to limit t | |||
- some options and behaviors are not applicable to Node.js and will be ignored by `node-fetch`. See this list of [known differences](https://github.com/node-fetch/node-fetch/blob/1780f5ae89107ded4f232f43219ab0e548b0647c/docs/v2-LIMITS.md). | |||
- `method` will automatically get upcased for consistency. | |||
|
|||
## Automatic Hashing Detection with `processHashing` | |||
|
|||
Our popular segment Adtect destinations support [automatic hash detection](https://segment.com/docs/connections/destinations/#hashing) of personally identifyable information (PII). If your destination hashes PII data, we recommend you use the `processHashing` utility instead of `createHash` from `crypto` module. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder should we explicitly say that this feature will detect if a string is already hashed, and will only apply a hash if the string is not already hashed?
Adds documentation about the new smart hashing module.
Testing
N/R: Documentation changes only.
Include any additional information about the testing you have completed to
ensure your changes behave as expected. For a speedy review, please check
any of the tasks you completed below during your testing.