Skip to content

Commit e4dc00f

Browse files
committed
refactor: rename Base64UrlSafe to Base64Url
1 parent b600747 commit e4dc00f

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ implementations support custom alphabets.
136136
padding. Main use is to have 100% alpha-numeric output, with or without
137137
upper-case.
138138
* Base85: High-density encoding (4 bytes to 5 characters).
139-
* Base64 / Base64UrlSafe: RFC 4648 compatible.
139+
* Base64 / Base64Url: RFC 4648 compatible.
140140

141141
Encoding `"any byte data"` (13 bytes):
142142

src/commonMain/kotlin/com/eignex/kencode/Base64.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ package com.eignex.kencode
33
const val BASE_64 =
44
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
55

6-
const val BASE_64_URL_SAFE =
6+
const val BASE_64_URL =
77
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
88

9-
object Base64UrlSafe : Base64(BASE_64_URL_SAFE.toCharArray())
9+
object Base64Url : Base64(BASE_64_URL.toCharArray())
1010

1111
/**
1212
* RFC 4648–compatible Base64 encoder/decoder.

src/commonTest/kotlin/com/eignex/kencode/Base64Test.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class Base64Test {
6464
}
6565

6666
@Test
67-
fun `fixed patterns should roundtrip for Base64UrlSafe`() {
67+
fun `fixed patterns should roundtrip for Base64Url`() {
6868
val patterns = listOf(
6969
byteArrayOf(),
7070
byteArrayOf(0),
@@ -77,7 +77,7 @@ class Base64Test {
7777

7878
for (bytes in patterns) {
7979
assertRoundtrip(
80-
Base64UrlSafe,
80+
Base64Url,
8181
bytes,
8282
"Failed for pattern=${bytes.toList()}"
8383
)

0 commit comments

Comments
 (0)