2020-08-13 11:46:07 +00:00
|
|
|
"""Nightscout util functions."""
|
2024-03-08 14:04:07 +00:00
|
|
|
|
2024-01-08 09:43:40 +00:00
|
|
|
from __future__ import annotations
|
|
|
|
|
2020-08-13 11:46:07 +00:00
|
|
|
import hashlib
|
|
|
|
|
|
|
|
|
2024-01-08 09:43:40 +00:00
|
|
|
def hash_from_url(url: str) -> str:
|
2020-08-13 11:46:07 +00:00
|
|
|
"""Hash url to create a unique ID."""
|
|
|
|
return hashlib.sha256(url.encode("utf-8")).hexdigest()
|