Description
Replace ordered nonoverlapping text spans with a supplied replacement.
Biosecurity administration records training assertions, custody, access purposes, inventories and document handling. Local counts, time checks and permission predicates describe supplied metadata; they do not authenticate people or items, enforce access or establish actual protective conditions.
Replace ordered nonoverlapping text spans with a supplied replacement.
When to use this tool
Use Biosecurity Log Redaction Length Budget when checking the stated benign biosecurity record, inventory, support or authorization convention.
How to use the tool and how it works
- Enter text, starts, ends, replacement. Follow any array-alignment requirements below. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read redacted, removedCodeUnits, resultingCodeUnits. Use the output convention below.
Replace ordered nonoverlapping text spans with a supplied replacement. Require aligned whole starts/ends in UTF-16 bounds and start >= prior end; splice half-open spans, return redacted text, removedCodeUnits and resultingCodeUnits.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| text | Text | Required. Text; maximum UTF-16 length 8192. |
| starts | Zero-based UTF-16 code-unit starts of ordered nonoverlapping half-open spans. | Required. Array of safe integer; maximum items 256. |
| ends | Exclusive UTF-16 code-unit ends; zero-length spans insert replacement text. | Required. Array of safe integer; maximum items 256. |
| replacement | Replacement | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| redacted | Redacted | Required. Text; maximum UTF-16 length 8192. |
| removedCodeUnits | Removed Code Units | Required. Safe integer. |
| resultingCodeUnits | Resulting Code Units | Required. Safe integer. |
{
"input": {
"text": "abcdefghi",
"starts": [
1,
6
],
"ends": [
3,
8
],
"replacement": "*"
},
"output": {
"redacted": "a*def*i",
"removedCodeUnits": 4,
"resultingCodeUnits": 7
}
} Limitations and assumptions
- Code-unit boundaries can split surrogate pairs and zero-length spans insert replacements; this does not identify sensitive data or guarantee deidentification.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Verify actual records, permissions and conditions through the responsible organization's procedures; use qualified risk assessment and appropriate professional oversight for practical decisions.
References
Similar or alternative tools
- Biosecurity Record Express Redaction Reason Code
Record a supplied redaction reason and actor.
- Biosecurity Record Minimal Field Filter
Filter named fields by supplied permission labels.