object Base64Long
Efficient conversion between Longs and base 64 encoded strings.
This is intended for use in e.g. cache keys.
- Alphabetic
- By Inheritance
- Base64Long
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val StandardBase64Alphabet: PartialFunction[Int, Char]
- def alphabet(chars: Iterable[Char]): PartialFunction[Int, Char]
Convert an ordered sequence of 64 characters into a base 64 alphabet.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fromBase64(chars: CharSequence): Long
Decode a full CharSequence as a base-64-encoded Long, using the standard base-64 alphabet.
- def fromBase64(chars: CharSequence, start: Int, end: Int, alphabet: PartialFunction[Char, Int] = StandardBase64AlphabetInverted): Long
Decode a sequence of characters representing a base-64-encoded Long, as produced by toBase64(Long).
Decode a sequence of characters representing a base-64-encoded Long, as produced by toBase64(Long). An empty range of characters will yield 0L. Leading "zero" digits will not cause overflow.
- alphabet
defines the mapping between characters in the string and 6-bit numbers.
- Note
Throws
,IllegalArgumentException
if any characters in the specified range are not in the specified base-64 alphabet.Throws
ArithmeticException
if the resulting value overflows a Long.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def invertAlphabet(forward: (Int) => Char): PartialFunction[Char, Int]
Invert a base 64 alphabet, creating a function suitable for use in
fromBase64
. - final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toBase64(builder: StringBuilder, l: Long, alphabet: (Int) => Char = StandardBase64Alphabet): Unit
Append a base-64 encoded Long to a StringBuilder.
Append a base-64 encoded Long to a StringBuilder.
The Base64 encoding uses the standard Base64 alphabet (with '+' and '/'). It does not pad the result. The representation is just like base 10 or base 16, where leading zero digits are omitted.
The number is treated as unsigned, so there is never a leading negative sign, and the representations of negative numbers are larger than positive numbers.
- def toBase64(l: Long): String
Convert this Long to a base 64 String, using the standard base 64 alphabet.
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()