Home Assistant Unofficial Reference
2024.12.1
utils.py
Go to the documentation of this file.
1
"""Nightscout util functions."""
2
3
from
__future__
import
annotations
4
5
import
hashlib
6
7
8
def
hash_from_url
(url: str) -> str:
9
"""Hash url to create a unique ID."""
10
return
hashlib.sha256(url.encode(
"utf-8"
)).hexdigest()
homeassistant.components.nightscout.utils.hash_from_url
str hash_from_url(str url)
Definition:
utils.py:8
core
homeassistant
components
nightscout
utils.py
Generated by
1.9.1