From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: Search through the string's space for find the target string whose md5sum matches the required condition. Date: Tue, 12 Oct 2021 19:45:36 +0800 Message-ID: References: <87bl3uy434.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22606"; mail-complaints-to="usenet@ciao.gmane.io" To: Emanuel Berg , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 12 13:47:45 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1maGG1-0005fA-60 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 12 Oct 2021 13:47:45 +0200 Original-Received: from localhost ([::1]:38658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maGFx-0007kC-MP for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 12 Oct 2021 07:47:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maGEC-0007i9-8q for help-gnu-emacs@gnu.org; Tue, 12 Oct 2021 07:45:54 -0400 Original-Received: from mail-ua1-x930.google.com ([2607:f8b0:4864:20::930]:34609) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maGE8-0002bd-S5 for help-gnu-emacs@gnu.org; Tue, 12 Oct 2021 07:45:51 -0400 Original-Received: by mail-ua1-x930.google.com with SMTP id h4so18028680uaw.1 for ; Tue, 12 Oct 2021 04:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=PDljB/KyFczhbHluUHhQOsh2yJffPCWuk0aereblLdA=; b=Q6bVdcAcQaEO9qG9sBlhgrrQPSGYZoJki5EOE9nrKDHFXWfhK5d33Hid4XWnvrpc7A sMh9FZ9Dz9i06IdIn832WK5Zk4d3P3q0gDuc9ULbatjv6kwxeS+ke6fyJCkFha8O3a5b mNvCzP4NUkXjl4LNvnhpBc83NUnSwGvlNLW+IdKL+Gibh0Yrj6iOHcRTYIL1mUkh2qkE rinuH3hUKdEmll7zwzWk0FURo2G4zTjnN3nuzRZTtj4kOzOB8/8juSR11OpesbDpTenI gOds9qe6ZlLOxIGobE9wT0FsOBiuE6y6wQd+tvcPyWfAFKJGXN3yajchEDvu66Jtiqo8 d3YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=PDljB/KyFczhbHluUHhQOsh2yJffPCWuk0aereblLdA=; b=i3Nu6xe3tP6QtajhHGGnIE3U7o336DeAoh96BlE315WYfMjqrdeSxzQjA1pAdWe1nB TBFU9JUpIHgiYBw6bFg18GMIwCZPuJj+xPhcTJh2ZksPbLI3QM3jU2521TcIIlacNDn7 l11pf7Ar2a0itjk8l5DiLJVh9YzcaJFTtGSKuQL9hGwTbnGFbLoGSQltYSH1M+ePQhUI 9EZjXE1EdyfIDIu9xLpaw6MCRLISCwgUaw6c+7Fo802veDOZU74A1P6YjzItB5WGralq 9PnV8d25YdQbsHcMo3muj6+TdiYIxpuZQUw77K1RGNIzQjnDsMeyOYfjQLJ1ZaKxsUDe gcXQ== X-Gm-Message-State: AOAM533JvPhlDbnu0S3DJpO3l6l0nR5D5d72B8ELG0bqFIle/6DmeHSi phKO+Ez/xBsNCHpaY/B6f0/cRZ9Cu24KY7VJQs2HcFZdSJdF8zhp X-Google-Smtp-Source: ABdhPJweiVvBEd2iqUxpgHhvdRUFi2DDtsnNoMDRgBFLh3gTwfJ1NF5bKhVgvCSGkYCbKjijZi/ozMj/Y0BO+shCGgE= X-Received: by 2002:ab0:29da:: with SMTP id i26mr21010490uaq.129.1634039147756; Tue, 12 Oct 2021 04:45:47 -0700 (PDT) In-Reply-To: <87bl3uy434.fsf@zoho.eu> Received-SPF: pass client-ip=2607:f8b0:4864:20::930; envelope-from=hongyi.zhao@gmail.com; helo=mail-ua1-x930.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:133753 Archived-At: On Tue, Oct 12, 2021 at 5:41 PM Emanuel Berg via Users list for the GNU Emacs text editor wrote: > > Hongyi Zhao wrote: > > > alphabet_uppercase=ascii_uppercase > > re_md5_str=re.compile(r'^E903[A-F0-9]{3}4DAB[A-F0-9]{4}08[A-F0-9]{5}51[A-F0-9]80[A-F0-9]{2}8A[A-F0-9]') > > > > #result_str=[] > > for i in alphabet_uppercase: > > i_str= 'TASC' + i > > for j in alphabet_uppercase: > > j_str = i_str + 'O3RJMV' + j > > for k in alphabet_uppercase: > > k_str = j_str + 'WDJKX' + k + 'ZM' > > #result_str.append(k_str) > > md5_str=md5(k_str.encode('utf-8')).hexdigest().upper() > > if re_md5_str.match(md5_str): > > md5_str = re_md5_str.match(md5_str)[0] > > print('The string: ' + k_str + '\n' + 'md5sum: ' + md5_str) > > ``` > > Jean should answer this, he does it for a living ... > > But, (require 'cl-lib) so you get the `cl-loop for' loop which > I dare say is better than the Python one at that. Then regexps > and `format' as you know ... no problem. One step at a time. > > See example of `cl-loop' here: > https://dataswamp.org/~incal/emacs-init/random-generic.el > > "Elisp is my favorite E" BTW <3 This is the most incomprehensible sentence. > you better believe it :) ... I believe. > -- > underground experts united > https://dataswamp.org/~incal