With more modern methods:
\documentclass{article}
\usepackage{algpseudocode}
\usepackage{hyperref}
\usepackage{cleveref}
% fix anchor names for algorithm lines
\newcounter{Halgorithmic}
\AtBeginEnvironment{algorithmic}{\stepcounter{Halgorithmic}}
\ExpandArgs{c}\newcommand{theHALG@line}{\arabic{Halgorithmic}.\arabic{ALG@line}}
\begin{document}
\begin{algorithmic}
\Procedure{Euclid}{$a,b$}
\EndProcedure
\end{algorithmic}
\begin{algorithmic}
\Procedure{Euclid}{$a,b$}
\EndProcedure
\end{algorithmic}
\end{document}
We inject code at the beginning of algoritmic, namely to step a dummy counter Halgorithmic and define \theHALG@line to yield
<current value of Halgorithmic>.<current value of ALG@line>
using the (documented) fact that hyperref uses, for its anchors, \theH<name> whenever it's defined, for every counter <name>.
The construction
\ExpandArgs{c}\newcommand{theHALG@line}{...}
is the same as
\expandafter\newcommand\csname theHALG@line\endcsname{...}
but it's definitely simpler (c stands for control sequence name).
algpseudocodexas well. – Caleb Stanford Jan 12 '23 at 20:17