IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

22 wiersze
501B

  1. #
  2. # Copyright (C) Stanislaw Adaszewski, 2020
  3. # License: GNU General Public License v3.0
  4. # URL: https://github.com/sadaszewski/focker
  5. # URL: https://adared.ch/focker
  6. #
  7. import random
  8. from .zfs import zfs_exists
  9. def random_sha256_hexdigest():
  10. return bytes([ random.randint(0, 255) for _ in range(32) ]).hex()
  11. def find_prefix(head, tail):
  12. for pre in range(7, len(tail)):
  13. name = head + tail[:pre]
  14. if not zfs_exists(name):
  15. break
  16. return name