Mask a card number
FreeLogic@rabbinatix/mask-a-card-number by Rabbinatixupdated Oct 4, 2026
Hides all but the last 4 digits: `************1111`.
Safe to show on receipts and in logs. A negative Start in Substring counts from the end, and Pad Start fills the rest with *.
Shows: Substring with a negative position, String Length, Pad Start.
How to use it
Add it to your logic, then add a Call Function step in any logic and pick Mask card. It belongs to no system, so every system can use it. Or download the TypeScript and call it from your own code.
Inputs
number: Text
Outputs
masked: Text
Previewdrag the steps around; scroll to zoom
Function Entry, Input / output. 0 inputs, 2 outputs. step 1 of 5
Mask card
number
Substring, String. 3 inputs, 1 output. step 2 of 5
Substring
text
start
end
result
String Length, String. 1 input, 1 output. step 3 of 5
String Length
text
length
Pad Start, String. 3 inputs, 1 output. step 4 of 5
Pad Start
text
length
fill
result
Return, Input / output. 2 inputs, 0 outputs. step 5 of 5
Return
masked
Arrow keys: next or previous step in flow order. Alt with arrows: nearest step in that direction. Enter: open. Shift F10: more actions.
Examplesrun live against the logic · 2/2 pass
| Passed | Example | Input | Output |
|---|---|---|---|
| A card | {"number":"4111111111111111"} | {"masked":"************1111"} | |
| Shorter than 4 | {"number":"123"} | {"masked":"123"} |
Try it
Versions
In this package
Mask card (entry)
