Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: ROT8000 implementation?

by LanX (Saint)
on Oct 15, 2021 at 23:47 UTC ( [id://11137616]=note: print w/replies, xml ) Need Help??


in reply to Re: ROT8000 implementation?
in thread ROT8000 implementation?

Hnngngng ... it's a misnomer

AFAIS

  • it's only operating on UCS-2 and ignoring the planes above
  • it's ignoring whitespaces by it's own definition of whitespace
  • it's avoiding some control characters

So not just a simple rotate by 0x8000 = 2^15!

One needs

  • an ordered list of all allowed characters.
  • divide them by two
  • map them in a lookup hash with 2^16 entries
  • the ignored ones map to themself

This JS implementation should be a good start for a Perl port

https://github.com/rottytooth/rot8000/blob/main/rot8000.js

You can use ord and chr to convert to codepoint and back

HTH!

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11137616]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-18 23:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found