rot8

package
v0.0.0-...-33b18b9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2021 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package rot8 provides utilities for rot8000 cyphering of Unicode text.

Index

Examples

Constants

View Source
const Bmp = 0x10000

Variables

View Source
var (
	// unicode.RangeTable of characters that will not be rotated.
	// This includes white space, control characters and surrogates.
	NonRotate = rangetable.Merge(
		unicode.Z,
		unicode.Cc,
		unicode.Cs,
		unicode.White_Space,
	)

	// Total number of non-rotatable characters.
	NonRotateCount = CountChars(NonRotate)

	// Total number of rotatable characters.
	RotateCount = Bmp - NonRotateCount

	// All rotatable characters.
	Runes []rune

	// Map of characters to its rotated counterpart's index in Runes.
	Map map[rune]int
)

Functions

func CountChars

func CountChars(table *unicode.RangeTable) int

Count total characters in a unicode.RangeTable.

func Rotate

func Rotate(s string) string

Rotate string by about 0x8000 code points.

Example
s := "Hello, World!"
r := Rotate(s)

fmt.Printf("r = %q\n", r)
Output:

r = "籑籮籵籵籸簵 籠籸类籵籭簪"

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL