rehydrate()
Replaces PII placeholders with original values.Signature
Parameters
string
required
Text containing PII placeholder tags
Map<string, string>
required
Decrypted PII map from
decryptPIIMap()boolean
default:"false"
If
true, use strict matching (exact tag format only). If false, use fuzzy matching that handles mangled tags from translation.TagFormat
Tag format configuration. Must match the format used during anonymization. Defaults to XML-style (
<PII type="..." id="N"/>).Returns
Text with placeholders replaced by original values.Example
decryptPIIMap()
Decrypts the encrypted PII map from an anonymization result.Signature
Parameters
EncryptedPIIMap
required
The encrypted PII map from
result.piiMapUint8Array
required
The encryption key (same key used during anonymization)
Returns
AMap<string, string> where:
- Key:
"TYPE:id"(e.g.,"EMAIL:1","PERSON:2") - Value: Original PII value
Example
Complete Workflow
Session-Based Rehydration
When using sessions, rehydration is simplified:Placeholder Format
By default, rehydrate expects placeholders in XML-style format:tagFormat used during anonymization:
type and id attributes.
Handling Malformed Placeholders
Error Handling
Missing Key
Missing PII Entry
Related
- Encryption - How PII maps are encrypted
- Sessions - Simplified rehydration with sessions
- Crypto - Key management utilities