mirror of
https://github.com/FlipsideCrypto/fsc-utils.git
synced 2026-02-06 10:56:49 +00:00
12 lines
310 B
PL/PgSQL
12 lines
310 B
PL/PgSQL
{% macro create_udf_hex_to_string(schema) %}
|
|
CREATE OR REPLACE FUNCTION {{ schema }}.udf_hex_to_string(hex STRING)
|
|
RETURNS TEXT
|
|
LANGUAGE SQL
|
|
STRICT IMMUTABLE AS
|
|
$$
|
|
SELECT
|
|
LTRIM(regexp_replace(
|
|
try_hex_decode_string(hex),
|
|
'[\x00-\x1F\x7F-\x9F\xAD]', '', 1))
|
|
$$;
|
|
{% endmacro %} |