@@ -436,7 +436,7 @@ defmodule Base do
436436 end
437437
438438 for { base , alphabet } <- [ upper: b16_alphabet , lower: to_lower_enc . ( b16_alphabet ) ] do
439- name = : "encode16#{ base } "
439+ name = String . to_unsafe_atom ( "encode16#{ base } " )
440440 encoded = to_encode_list . ( alphabet )
441441
442442 @ compile { :inline , [ { name , 1 } ] }
@@ -617,10 +617,10 @@ defmodule Base do
617617 upper = Enum . with_index ( b16_alphabet )
618618
619619 for { base , alphabet } <- [ upper: upper , lower: to_lower_dec . ( upper ) , mixed: to_mixed_dec . ( upper ) ] do
620- decode_name = : "decode16#{ base } !"
621- validate_name = : "validate16#{ base } ?"
622- valid_char_name = : "valid_char16#{ base } ?"
623- valid_word_name = : "valid_word16#{ base } ?"
620+ decode_name = String . to_unsafe_atom ( "decode16#{ base } !" )
621+ validate_name = String . to_unsafe_atom ( "validate16#{ base } ?" )
622+ valid_char_name = String . to_unsafe_atom ( "valid_char16#{ base } ?" )
623+ valid_word_name = String . to_unsafe_atom ( "valid_word16#{ base } ?" )
624624
625625 { min , decoded } = to_decode_list . ( alphabet )
626626
@@ -735,7 +735,7 @@ defmodule Base do
735735 end
736736
737737 for { base , alphabet } <- [ base: b64_alphabet , url: b64url_alphabet ] do
738- name = : "encode64#{ base } "
738+ name = String . to_unsafe_atom ( "encode64#{ base } " )
739739 encoded = to_encode_list . ( alphabet )
740740
741741 @ compile { :inline , [ { name , 1 } ] }
@@ -1001,12 +1001,12 @@ defmodule Base do
10011001 end
10021002
10031003 for { base , alphabet } <- [ base: b64_alphabet , url: b64url_alphabet ] do
1004- decode_name = : "decode64#{ base } !"
1004+ decode_name = String . to_unsafe_atom ( "decode64#{ base } !" )
10051005
1006- validate_name = : "validate64#{ base } ?"
1007- validate_main_name = : "validate_main64#{ validate_name } ?"
1008- valid_char_name = : "valid_char64#{ base } ?"
1009- valid_word_name = : "valid_word64#{ base } ?"
1006+ validate_name = String . to_unsafe_atom ( "validate64#{ base } ?" )
1007+ validate_main_name = String . to_unsafe_atom ( "validate_main64#{ validate_name } ?" )
1008+ valid_char_name = String . to_unsafe_atom ( "valid_char64#{ base } ?" )
1009+ valid_word_name = String . to_unsafe_atom ( "valid_word64#{ base } ?" )
10101010 { min , decoded } = alphabet |> Enum . with_index ( ) |> to_decode_list . ( )
10111011
10121012 # SWAR fast path: 7 bytes per stride, validated via `valid_word64<base>?`
@@ -1314,7 +1314,7 @@ defmodule Base do
13141314 hexupper: b32hex_alphabet ,
13151315 hexlower: to_lower_enc . ( b32hex_alphabet )
13161316 ] do
1317- name = : "encode32#{ base } "
1317+ name = String . to_unsafe_atom ( "encode32#{ base } " )
13181318 encoded = to_encode_list . ( alphabet )
13191319
13201320 @ compile { :inline , [ { name , 1 } ] }
@@ -1653,16 +1653,16 @@ defmodule Base do
16531653 hexlower: to_lower_dec . ( hexupper ) ,
16541654 hexmixed: to_mixed_dec . ( hexupper )
16551655 ] do
1656- decode_name = : "decode32#{ base } !"
1657- validate_name = : "validate32#{ base } ?"
1658- validate_main_name = : "validate_main32#{ validate_name } ?"
1659- valid_char_name = : "valid_char32#{ base } ?"
1656+ decode_name = String . to_unsafe_atom ( "decode32#{ base } !" )
1657+ validate_name = String . to_unsafe_atom ( "validate32#{ base } ?" )
1658+ validate_main_name = String . to_unsafe_atom ( "validate_main32#{ validate_name } ?" )
1659+ valid_char_name = String . to_unsafe_atom ( "valid_char32#{ base } ?" )
16601660 { min , decoded } = to_decode_list . ( alphabet )
16611661
16621662 # SWAR fast path: 7 bytes per stride, validated via `valid_word32<base>?`
16631663 # in the body. Tail leftover (1-6 bytes after a 7-byte stride hits an
16641664 # 8-byte-multiple `main`) recurses through the single-byte clause.
1665- valid_word_name = : "valid_word32#{ base } ?"
1665+ valid_word_name = String . to_unsafe_atom ( "valid_word32#{ base } ?" )
16661666
16671667 defp unquote ( validate_main_name ) ( << w :: 56 , rest :: binary >> ) ,
16681668 do: unquote ( valid_word_name ) ( w ) and unquote ( validate_main_name ) ( rest )
0 commit comments