File: //proc/self/root/usr/lib/python3.9/site-packages/ansible/utils/__pycache__/encrypt.cpython-39.pyc
a
�)g) �
@ s� d dl mZmZmZ eZd dlZd dlZd dlZd dl Z d dl
Z
d dlmZ d dl
mZ d dlmZmZ d dlmZ d dlmZmZ d dlmZ d ZZd ZZzXd dlZd dlZd d
l m!Z!m"Z" zd dl#m$Z$ W n e%y� d dl&m$Z$ Y n0 dZW n* e'�y" Z( ze(ZW Y dZ([(n
dZ([(0 0 zd dl)Z)dZW n* e'�y^ Z( ze(ZW Y dZ([(n
dZ([(0 0 e� Z*d
gZ+e�,� Z-dZ.e.ej/dfdd�Z0ddd�Z1G dd� de2�Z3G dd� de3�Z4G dd� de3�Z5ddd�Z6ddd
�Z7dS ) � )�absolute_import�division�print_functionN)�
namedtuple)� constants)�AnsibleError�AnsibleAssertionError)� text_type)�to_text�to_bytes)�DisplayF)�
HasRawSalt�
PrefixWrapper)�bcrypt64T�
do_encrypt� c sX t � t�std� t� �f ��|du r0t�� �n
t�|��d�� �fdd�t| �D ��S )a Return a random password string of length containing only chars
:kwarg length: The number of characters in the new password. Defaults to 20.
:kwarg chars: The characters to choose from. The default is all ascii
letters, ascii digits, and these symbols ``.,:-_``
z%s (%s) is not a text_typeN� c 3 s | ]}�� � �V qd S �N)�choice)�.0Zdummy��charsZrandom_generator� �9/usr/lib/python3.9/site-packages/ansible/utils/encrypt.py� <genexpr>A � z"random_password.<locals>.<genexpr>) �
isinstancer r �type�randomZSystemRandomZRandom�join�range)�lengthr Zseedr r r �random_password3 s
r"